<template>
  <van-row>
    <card-rectify :ref="'page'+(index + 1)" :id="'page'+(index + 1)" v-for="(item,index) in items" :item="item" :key="item.id" @click.native="$emit('click', item)"/>
  </van-row>
</template>

<script>
import CardRectify from '@/views/rectify/common/card/CardRectify'
export default {
  name: 'PanelRectifyList',
  components: { CardRectify },
  props: ['items'],
  data(){
    return{
      number:0,
    }
  },
  methods:{
        //点击跳转到错误行
    clickscrollPage(){
      console.log(this.items)
      console.log(this.$route.query.problem_id)
      this.items.forEach((item,index) => {
        if(this.$route.query.problem_id == item.id){
          console.log(index)
          if(index != 0){
            const PageId = document.querySelector('#page' + index)
            PageId.scrollIntoView({behavior:'smooth',block:'center',inline:'start'})
          }
          var oUl = document.getElementById('page'+(index + 1));
          oUl.style.background = '#f8dcdc'
        }
      });


    },
  },
}
</script>

<style scoped>

</style>
